package com.badibadi.mail;

import com.badibadi.activity.BaseActivity;
import com.badibadi.activity.ConsultingEvaluationActivity;
import com.badibadi.infos.PayUserContactShow1Model;
import com.badibadi.uniclubber.R;
import com.badibadi.uniclubber.R.id;
import com.badibadi.uniclubber.R.layout;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.TextView;
/**
 * 
 * （问方对答方第二次不满意了）再次不满意的：（交易失败）直接评价
 * @author Administrator
 *
 */
public class MailSeeZaicibumanyiActivity extends BaseActivity {

	PayUserContactShow1Model payUserContactShow1Model;
	String is_dafang;// 是否是答方 0不是 1是

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		goToTheTitle();
		setContentView(R.layout.activity_mail_see_zaicibumanyi);
		payUserContactShow1Model = (PayUserContactShow1Model) getIntent()
				.getSerializableExtra("payUserContactShow1Model");

		is_dafang = getIntent().getStringExtra("flags");
		
		
		this.findViewById(R.id.return_btn).setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				finish();
			}
		});
		
		//不满意原因
		TextView contents=(TextView)this.findViewById(R.id.contents);
		contents.setText(""+payUserContactShow1Model.getZhannei_usercontact().get(0).getDissatisfied_reason());
		if (is_dafang.equals("1"))// 答方
		{
			this.findViewById(R.id.wenfangsee).setVisibility(View.GONE);
//评价
			this.findViewById(R.id.pingjia).setOnClickListener(new View.OnClickListener() {
				
				@Override
				public void onClick(View v) {
					// TODO Auto-generated method stub
					Intent intent=new Intent(MailSeeZaicibumanyiActivity.this,ConsultingEvaluationActivity.class);
					intent.putExtra("uid", payUserContactShow1Model.getSent_uid());
					intent.putExtra("chuanru_zhanneiId", payUserContactShow1Model.getZhannei_Id());
					intent.putExtra("chuanru_asker_or_answerer", "answerer");
					startActivity(intent);
					
				}
			});
			
			
			
		} else {
			this.findViewById(R.id.dafangsee).setVisibility(View.GONE);
			//评价
	this.findViewById(R.id.pingjia).setOnClickListener(new View.OnClickListener() {
				
				@Override
				public void onClick(View v) {
					// TODO Auto-generated method stub
					Intent intent=new Intent(MailSeeZaicibumanyiActivity.this,ConsultingEvaluationActivity.class);
					intent.putExtra("uid", payUserContactShow1Model.getUid());
					intent.putExtra("chuanru_zhanneiId", payUserContactShow1Model.getZhannei_Id());
					intent.putExtra("chuanru_asker_or_answerer", "asker");
					startActivity(intent);
				}
			});
		}
	}

}
